#ifndef __MCSC_INVALID_TYPE_EXCEPTION__HPP
#define __MCSC_INVALID_TYPE_EXCEPTION__HPP

#include "CompileException.hpp"

class InvalidTypeException : public CompileException
{
public:
	InvalidTypeException(SourceLocation const & location, String typeName)
		: CompileException(location)
		, typeName_(typeName)
	{}

	String typeName() const { return typeName_; }

	std::ostream & stream(std::ostream & str) const
	{
		return CompileException::stream(str) << "\"" << typeName_ << "\" is not a valid type name";
	}
private:
	String typeName_;
};

#endif //__MCSC_INVALID_TYPE_EXCEPTION__HPP